package org.vox.homepage.service.impl

import javax.annotation.Resource

import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
import org.vox.homepage.dao.UserDao
import org.vox.homepage.service.HomepageService

/**
  * @author merlin
  */
@Service
class HomepageServiceImpl extends HomepageService {

  import HomepageServiceImpl.logger

//  @Resource
  var userDao: UserDao = _

  /**
    *
    * @param userId   user's unique id
    * @param password user's password
    * @return
    */
  override def login(userId: String, password: String): Unit = {
    if (logger.isDebugEnabled()) {
      logger.debug("login is process, userId: " + userId + ". password: " + password)
    }

    val user = userDao.getUser(userId)

    if (password.equals(user.getPassword)) {
      
    }
  }
}

object HomepageServiceImpl {
  val logger = LoggerFactory.getLogger(classOf[HomepageServiceImpl])
}